
//
//  ViewFactory.h
//  CarCare
//
//  Created by ileo on 14-8-30.
//  Copyright (c) 2014年 baozun. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Factory.h"

typedef NS_ENUM(NSInteger, TEXTFIELD_TYPE){
    TEXTFIELD_TEL,
    TEXTFIELD_PWD,
    TEXTFIELD_CODE,
    TEXTFIELD_Ali,
    TEXTFIELD_Name,
    TEXTFIELD_REALName,
    TEXTFIELD_IDCARD,
    TEXTFIELD_Money,
    TEXTFIELD_ENGINE,
    TEXTFIELD_VIN,
    TEXTFIELD_Default_Num,
    TEXTFIELD_NORMAL,
};

typedef NS_ENUM(NSInteger, BUTTON_TYPE){
    BUTTON_EYE,
    BUTTON_CODE,
    BUTTON_Money,
    BUTTON_TEL,
    BUTTON_DEVICE_CODE
};

#define FactoryRect(y,width,height) CGRectMake((__MAIN_WIDTH - (width))/2, y, width, height)

#define FactoryHigh (50*__MAIN_RATIO_H_667)

#define FactoryWidth __MAIN_WIDTH

#define FactoryRectDefault(y) CGRectMake((__MAIN_WIDTH - FactoryWidth)/2, y, FactoryWidth, FactoryHigh)
#define FactoryRectButtonDefault(y) CGRectMake((__MAIN_WIDTH - (324*__MAIN_RATIO_375))/2, y, (324*__MAIN_RATIO_375), 40*__MAIN_RATIO_375)

@interface ViewFactory : NSObject

+(UIButton *)buttonWithFrame:(CGRect)frame title:(NSString *)title normalColor:(UIColor *)normal highlightColor:(UIColor *)highlight disabledColor:(UIColor *)disabled inView:(UIView *)view action:(void(^)())action;

+(UIButton *)normalButtonWithFrame:(CGRect)frame title:(NSString *)title inView:(UIView *)view action:(void(^)())action;

+(UIButton *)emptyButtonWithFrame:(CGRect)frame title:(NSString *)title inView:(UIView *)view action:(void(^)())action;

+(UITextField *)textFieldWithFrame:(CGRect)frame type:(TEXTFIELD_TYPE)type hasBG:(BOOL)bg inView:(UIView *)view;

+(UIButton *)addButtonType:(BUTTON_TYPE)type onTextField:(UITextField *)textField inView:(UIView *)view action:(void(^)())action ok:(void(^)())ok;

+(UILabel *)addTextLabel:(NSString *)text onTextField:(UITextField *)textField inView:(UIView *)view;

+(UILabel *)labelWithMaxWidth:(CGFloat)maxWidth resetSizeFinish:(void(^)(UILabel *label))finish text:(NSString *)text inView:(UIView *)view;

+(TipsView *)factoryCreateVisiterTips;

@end
